from django.shortcuts import redirect
from django.utils.deprecation import MiddlewareMixin
from django.http import HttpResponse

class Login(MiddlewareMixin):
    def process_request(self, request):
        if request.path in ['/sjgauth/sjglogin/']:
            print('write path')
            return None
        elif request.user.is_authenticated:
            # print(request.user, type(request.user))
            # print(request.user.pk, request.user.username, request.user.email)
            pass
        else:
            print('not login')
            return redirect('/static/login.html')